#------------------------------------------------------------------------------
# definiendo fuentes para la libreria
#------------------------------------------------------------------------------
FILE(GLOB_RECURSE log_headers "src/*.h")
FILE(GLOB_RECURSE log_sources "*src/*.cpp")



#------------------------------------------------------------------------------
# Generando libreria "log"
#------------------------------------------------------------------------------
message("Generating library log")
ADD_LIBRARY(log STATIC ${log_sources} ${log_headers})

#------------------------------------------------------------------------------
# definiendo fuentes para el ejecutable de tests
#------------------------------------------------------------------------------
FILE(GLOB_RECURSE test_log_headers "test/*.h")
FILE(GLOB_RECURSE test_log_sources "test/*.cpp")

SET(TEST_LIBS ${THIRD_PARTY_LIBS}/libgtest.a ${THIRD_PARTY_LIBS}/libgtest_main.a pthread log "${BOOST_DIR}/stage/lib/libboost_system.a")
SET(CORE_LIB ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/libcore.a)
INCLUDE_DIRECTORIES(
	"${PROJECT_BINARY_DIR}/${THIRD_PARTY_INC_DIR}"
	"${PROJECT_SOURCE_DIR}/modules/Log/src"
)
include_directories(
	"${PROJECT_SOURCE_DIR}/modules/Log/src"
	"${PROJECT_SOURCE_DIR}/modules/core/src"
  )

#------------------------------------------------------------------------------
# Generando ejecutable de test unitarios
#------------------------------------------------------------------------------
ADD_EXECUTABLE(log_test ${test_log_sources} ${test_log_headers})
TARGET_LINK_LIBRARIES(log_test ${TEST_LIBS} ${CORE_LIB})

#------------------------------------------------------------------------------
# Ejecutando test cases
#------------------------------------------------------------------------------
enable_testing()
IF(ZEL_EXECUTE_TESTS)
	add_test(NAME testing_log 
				COMMAND log_test)
ENDIF()